import java.util.PriorityQueue;


public class TestDemo {

    public static void main(String[] args) {
        int[] array = {27,15,19,18,28,34,65,49,25,37};
        TestHeap testHeap = new TestHeap();
        testHeap.createHeap(array);
        testHeap.heapSort();
        System.out.println("===========");
//        testHeap.offer(80);
//        System.out.println("=================");
//        System.out.println(testHeap.poll());
//        System.out.println(testHeap.peek());

    }

    public static void main2(String[] args) {
        //默认就是一个小根堆
        PriorityQueue<Integer> priorityQueue = new PriorityQueue<>();
        //每放一个元素 都得保证当前的堆 是大堆 或者是小堆
        priorityQueue.offer(12);
        priorityQueue.offer(3);
        priorityQueue.offer(15);

        System.out.println(priorityQueue.poll());
        System.out.println(priorityQueue.poll());

    }


}